call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"

echo on

msbuild "Granite Xaml.sln" /t:clean /p:Configuration=Debug-Fast
msbuild "Granite Xaml.sln" /t:clean /p:Configuration=Debug
msbuild "Granite Xaml.sln" /t:clean /p:Configuration=Release
msbuild "Granite Xaml.sln" /t:rebuild /p:Configuration=Release

pause

rd "Build" /s /q
md "Build"

md Build\lib\net40
md Build\lib\net40\CodeContracts
md Build\lib\sl4
md Build\lib\sl4\CodeContracts
md Build\lib\sl3-wp
md Build\lib\sl4-windowsphone71
md Build\lib\sl5
md Build\lib\sl5\CodeContracts

copy Granite.Xaml.net40\bin\Release\*.dll Build\lib\net40
copy Granite.Xaml.net40\bin\Release\*.pdb Build\lib\net40
copy Granite.Xaml.net40\bin\Release\*.xml Build\lib\net40

copy Granite.Xaml.net40\bin\Release\CodeContracts\*.dll Build\lib\net40\CodeContracts
copy Granite.Xaml.net40\bin\Release\CodeContracts\*.pdb Build\lib\net40\CodeContracts
copy Granite.Xaml.net40\bin\Release\CodeContracts\*.xml Build\lib\net40\CodeContracts

copy Granite.Xaml.sl4\bin\Release\*.dll Build\lib\sl4
copy Granite.Xaml.sl4\bin\Release\*.pdb Build\lib\sl4
copy Granite.Xaml.sl4\bin\Release\*.xml Build\lib\sl4

copy Granite.Xaml.sl4\bin\Release\CodeContracts\*.dll Build\lib\sl4\CodeContracts
copy Granite.Xaml.sl4\bin\Release\CodeContracts\*.pdb Build\lib\sl4\CodeContracts
copy Granite.Xaml.sl4\bin\Release\CodeContracts\*.xml Build\lib\sl4\CodeContracts

copy Granite.Xaml.sl3-wp\bin\Release\*.dll Build\lib\sl3-wp
copy Granite.Xaml.sl3-wp\bin\Release\*.pdb Build\lib\sl3-wp
copy Granite.Xaml.sl3-wp\bin\Release\*.xml Build\lib\sl3-wp

copy Granite.Xaml.sl4-windowsphone71\bin\Release\*.dll Build\lib\sl4-windowsphone71
copy Granite.Xaml.sl4-windowsphone71\bin\Release\*.pdb Build\lib\sl4-windowsphone71
copy Granite.Xaml.sl4-windowsphone71\bin\Release\*.xml Build\lib\sl4-windowsphone71

copy Granite.Xaml.sl5\bin\Release\*.dll Build\lib\sl5
copy Granite.Xaml.sl5\bin\Release\*.pdb Build\lib\sl5
copy Granite.Xaml.sl5\bin\Release\*.xml Build\lib\sl5

copy Granite.Xaml.sl5\bin\Release\CodeContracts\*.dll Build\lib\sl5\CodeContracts
copy Granite.Xaml.sl5\bin\Release\CodeContracts\*.pdb Build\lib\sl5\CodeContracts
copy Granite.Xaml.sl5\bin\Release\CodeContracts\*.xml Build\lib\sl5\CodeContracts

copy Granite.Xaml.nuspec Build

cd Build
del *.CodeAnalysisLog.xml /s

notepad Granite.Xaml.nuspec

echo Press Enter after fixing build number

pause

NuGet pack Granite.Xaml.nuspec

